package com.smart.manager.product.entities.body;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.product.entities.enums.PigstyKind;
import com.smart.manager.product.entities.enums.ProfileStage;
import com.smart.manager.product.entities.enums.ProfileStatus;
import com.smart.manager.product.entities.views.PigBreedView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * 猪仔配置 - 销售设置
 * @author leo
 * @date 2023/09/07
 */
public class RPigGoods {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RPigGoods1")
    public static class SearchBody extends BaseSearch {

        @ApiModelProperty("商品代码")
        private String code;

        @ApiModelProperty("商品名称")
        private String name;

        @ApiModelProperty("喂养模式")
        private PigstyKind mode;

        @ApiModelProperty("是否促销")
        private Boolean promotion;

        @ApiModelProperty("销售状态")
        private ProfileStatus status;

    }


    @Data
    @ApiModel("RPigGoods2")
    public static class EditBody  implements Serializable {

        @ApiModelProperty("商品代码")
        @NotBlank(message = "商品代码 不能为空")
        private String code;

        @ApiModelProperty("商品名称")
        @NotBlank(message = "商品名称 不能为空")
        private String name;

        @ApiModelProperty("猪仔日龄")
        @NotNull(message = "猪仔日龄 不能为空")
        @Min(value = 0,message = "猪仔日龄 不能小于0")
        private Integer dayNum;

        @ApiModelProperty("是否允许兑换")
        @NotNull(message = " 是否允许兑换 不能为空")
        private Boolean isExchange;

        @ApiModelProperty("猪仔预估体重")
        @NotNull(message = "猪仔预估体重 不能为空")
        @Min(value = 0,message = "猪仔预估体重 不能小于0")
        private Integer weight;

        @ApiModelProperty("喂养模式")
        @NotNull(message = "喂养模式 不能为空")
        private PigstyKind mode;

        @ApiModelProperty("猪仔档案")
        @NotNull(message = "猪仔档案 不能为空")
        private PigBreedView breed;

        @ApiModelProperty("包含月份")
        private Integer month;

        @ApiModelProperty("所属阶段")
        private ProfileStage stage;

        @ApiModelProperty("认养赠送(鸡)")
        private Integer chicken;

        @ApiModelProperty("全额价格")
        private Integer fullPrice;

        @ApiModelProperty("认养赠送(蛋)")
        private Integer egg;

        @ApiModelProperty("商品介绍")
        private String introduce;

        @ApiModelProperty("商品图片")
        private String img;

        @ApiModelProperty("备用金(+)")
        @NotNull(message = "所需备用金 不能为空")
        private Integer reserveFund;

        @ApiModelProperty("钻石抵扣金额(-)")
        private Integer deduction;

        @ApiModelProperty("保险金(+)")
        private Integer insurance;

        @ApiModelProperty("养猪险(+)")
        private Integer accident;

        @ApiModelProperty("显示猪仔价格")
        private Integer showPrice;

        @ApiModelProperty("销售猪仔价格")
        @NotNull(message = "销售猪仔价格 不能为空")
        private Integer price;

        @ApiModelProperty("销售状态")
        @NotNull(message = "销售状态 不能为空")
        private ProfileStatus status;

        @ApiModelProperty("销售库存")
        @NotNull(message = "销售库存 不能为空")
        private Integer stock;

        @ApiModelProperty("是否促销")
        @NotNull(message = "是否促销 不能为空")
        private Boolean promotion;

        @ApiModelProperty("促销标语")
        private String msg;

        @ApiModelProperty("显示排序")
        @Min(value = 0,message = "显示排序 不能小于0")
        @Max(value = 999,message = "显示排序 不能大于999")
        private Integer sort;
    }
}
